﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CalendarDemo
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            calendario.BlackoutDates.AddDatesInPast();
            calendario.SelectedDatesChanged += 
                new EventHandler<SelectionChangedEventArgs>(calendario_SelectedDatesChanged);
        }

        void calendario_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
        {
            fechasSeleccionadas.Text = "Fechas seleccionadas: ";
            foreach (DateTime fecha in calendario.SelectedDates)
            {
                fechasSeleccionadas.Text += fecha.ToShortDateString() + " ";
            }
        }
    }
}
